# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=govc
pkgver=0.37.1
pkgrel=0
pkgdesc="vSphere CLI built on top of govmomi"
url="https://github.com/vmware/govmomi/blob/main/govc/README.md"
arch="all"
license="Apache-2.0"
makedepends="go bash coreutils"
source="https://github.com/vmware/govmomi/archive/v$pkgver/govc-$pkgver.tar.gz"
builddir="$srcdir/govmomi-$pkgver/govc"
# !check: no tests provided
# net: fetch dependencies
options="!check net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o "$builddir"/govc .
}

package() {
	install -Dm755 "$builddir"/govc "$pkgdir"/usr/bin/govc
}

sha512sums="
b191c043a596ba8a0528c3f1761736d8ed50a4129e37db58dd16ecbfa1f78f175168ed273e920c1d74377244687a6d10feb7a10683b2f516899156febef9e11c  govc-0.37.1.tar.gz
"
